function to2(m) {		//个位数补0操作
  	if (m < 10) {
  		return '0' + m;
  	}
  	return m;
  }
  let date = {
  	nowDate() {		//格式化当前日期时间
  		var myDate = new Date();
  		var year = myDate.getFullYear();
  		var month = to2(myDate.getMonth() + 1);
  		var day = to2(myDate.getDate());
  		var hour = to2(myDate.getHours());
  		var minute = to2(myDate.getMinutes());
  		var second = to2(myDate.getSeconds());
  		return year + "-" + month + "-" + day + " " + hour + ":" + minute + ":" + second;
  	},
  	frometDate(date) {		//格式化指定日期时间
  		var myDate = date;
  		var year = myDate.getFullYear();
  		var month = to2(myDate.getMonth() + 1);
  		var day = to2(myDate.getDate());
  		var hour = to2(myDate.getHours());
  		var minute = to2(myDate.getMinutes());
  		var second = to2(myDate.getSeconds());
  		return year + "-" + month + "-" + day + " " + hour + ":" + minute + ":" + second;
  	}
  }
  export default date;		//抛出
